package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.Mapper;

/**
 * Alt+7 查看当前类结构
 * BaseMapper<Dept>
 *     BaseMapper MP实现了很多CRUD方法
 *     Dept实体类，MP会以Dept类的小写作为表名，Dept实体类里面的属性作为查询数据库的字段
 */
@Mapper
public interface DeptMapper extends BaseMapper<Dept> {
    //里面的代码全部删除或注释
    /*
    @Select("select id, name, create_time, update_time from dept order by update_time desc ")
    List<Dept> findAll();

    @Delete("delete from dept where id = #{id}")
    void deleteById(Integer id);

    @Insert("insert into dept(name, create_time, update_time) values (#{name}, #{createTime}, #{updateTime})")
    void save(Dept dept);

    @Select("select id, name, create_time, update_time from dept where id = #{id}")
    Dept getById(Integer id);
    */
    void update(Dept dept);
}